<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<title>志愿靓号随心选</title>
		<link rel="stylesheet" href="__PUBLIC__/css/pulic.css" />
		<script src="__PUBLIC__/js/jquery-1.9.1.min.js"></script>
		<SCRIPT type="text/javascript">
		function check(){	
			// 身份证号码为15位或者18位，15位时全为数字，18位前17位为数字，最后一位是校验位，可能为数字或字符X  
		    var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; 
			
			if(!reg.test($("#idcard").val())){
				alert('身份证格式不正确！');
				document.getElementById("idcard").value = '';
				document.getElementById("idcard").focus();
				return false;
			}

		}
		
		</SCRIPT>
	</head>
	<body>
		<div class="banner"><img src="__PUBLIC__/images/banner.png"/></div>
		<div class="contDv activeNum">
			<div class="formA clearfix">
				<span class="form2Txt">选择号码</span>
				<div class="confirmNumber">
					<p>{$number}</p>
				</div>
			</div>
			<div class="formA clearfix">
				<span class="form2Txt">预存资费</span>
				<div class="confirmNumber">
					<p>{$payment}</p>
				</div>
			</div>
			<div class="formA clearfix">
				<span class="form2Txt">套餐</span>
				<div class="confirmNumber">
					<p>{$package}</p>
				</div>
			</div>
		</div>
		<div class="contDv">
			<div class="selectNumber clearfix">
				<span>请填写以下信息</span>
			</div>
			<form  action="__APP__/Index/postperson" method="post" onsubmit = 'return check()'>
				<div class="formB">
					<div class="formIpt">
						<input type="text" name='username' id='username' required placeholder="请输入姓名"/>
					</div>
					<div class="formIpt clearfix iptB">
						<input class="verifyTxt fl" type="text"  id ='contactphone'  name ='contactphone' placeholder="请输入联系电话"/>
						<input class="verifyBtn fl" id="btn" onclick="sendMessage()" type="button" value="获取验证码"/>
					</div>
					<div class="formIpt">
						<input type="text" name = 'vcode' required id = 'vcode' placeholder="请输入短信验证码"/>
					</div>
					<div class="formIpt">
						<input type="text" name = 'idcard' required id = 'idcard' placeholder="请输入身份证号码"/>
					</div>
					<div class="formIpt">
						<select class="selectA" required name = 'hall' id = 'hall'>
							<option value="">请选择营业厅</option>
							<option value="科创路">科创路</option>
							<option value="互助路">互助路</option>
							<option value="长乐坊">长乐坊</option>
							<option value="凤城四路">凤城四路</option>
							<option value="大差市">大差市</option>
							<option value="电子城">电子城</option>
							<option value="大寨路">大寨路</option>
							<option value="南稍门">南稍门</option>
							<option value="北稍门">北稍门</option>
							<option value="未央路">未央路</option>
							<option value="沣镐东路">沣镐东路</option>
							<option value="大庆路">大庆路</option>
							<option value="尚朴路">尚朴路</option>
							<option value="纬二街">纬二街</option>
							<option value="三森">三森</option>
							<option value="公园南路">公园南路</option>
							<option value="高新">高新</option>
							<option value="纺正街">纺正街</option>
							<option value="凯米广场">凯米广场</option>
							<option value="长缨东路">长缨东路</option>
							<option value="金花北路">金花北路</option>
							<option value="长路东路">长路东路</option>
							<option value="大兴西路">大兴西路</option>
							<option value="矿山路">矿山路</option>
							<option value="凤城八路">凤城八路</option>
							<option value="含元殿">含元殿</option>
							<option value="凤城十路">凤城十路</option>
							<option value="桃园南路">桃园南路</option>
							<option value="西稍门">西稍门</option>
							<option value="汉城路">汉城路</option>
							<option value="端履门">端履门</option>
							<option value="解放路">解放路</option>
							<option value="西北三路">西北三路</option>
							<option value="丰庆路">丰庆路</option>
							<option value="崇业路">崇业路</option>
							<option value="文艺路">文艺路</option>
							<option value="大雁塔">大雁塔</option>
							<option value="长乐中路">长乐中路</option>
							<option value="外事学院">外事学院</option>
							<option value="朝阳门">朝阳门</option>
						</select>
					</div>
				</div>
				<input type='hidden' name='number' value="{$number}" />
				<input type='hidden' name='payment' value="{$payment}" />
				<input type='hidden' name='package' value="{$package}" />

				<input type='submit' class="subBtn"  value = '提交' />

			</form>	
		</div>
		
		
	</body>
	<script type="text/javascript" src="__PUBLIC__/js/puclic.js" ></script>
	<script type="text/javascript">
	var InterValObj; //timer变量，控制时间  
	var count = 60; //间隔函数，1秒执行  
	var curCount;//当前剩余秒数  
	function sendMessage() {  
		curCount = count;  
	    var phone=$("#contactphone").val();//手机号码  
	    if(phone != ""){  
	        //设置效果，开始计时  
	        $("#btn").attr("disabled", "true");  
	        $("#btn").val("请在" + curCount + "秒内输入验证码");  
	        InterValObj = window.setInterval(SetRemainTime, 1000); //启动计时器，1秒执行一次  
	    //向后台发送处理数据  
	          $.ajax({  
	            type: "POST", //用POST方式传输  
	            dataType: "text", //数据格式:JSON  
	            url: '__APP__/Index/send', //目标地址  
	            data: "number=" + phone ,  
	            error: function (XMLHttpRequest, textStatus, errorThrown) { },  
	            success: function (msg){ }   
	        });   
	    }else{  
	        alert("手机号码不能为空！");  
	    }   
	}  
	//timer处理函数  
	function SetRemainTime() {  
	    if (curCount == 0) {                  
	        window.clearInterval(InterValObj);//停止计时器  
	        $("#btn").removeAttr("disabled");//启用按钮  
	        $("#btn").val("重新发送验证码");  
	        code = ""; //清除验证码。如果不清除，过时间后，输入收到的验证码依然有效      
	    }  
	    else {  
	    	curCount--;  
	        $("#btn").val("请在" + curCount + "秒内输入验证码");  
	    }  
	}  
</script>
</html>
